package com.jg.visitor.common.bean;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "app-configs")
@Getter
@Setter
@ToString
@SuppressWarnings("all")
@Slf4j
public class AppConfigs {

    private static String SYSTEM = "";

    static {
        SYSTEM = System.getProperty("os.name");
    }

    private String uploadImgPath;

    private String wechatAppId;

    private String wechatAppSecret;

    private String wechatGrantType;

    private String environment;

    private String miniprogramState;

    private String templateId;

    private String language;

    private String page;

    private String version;

    private Long adminExpiredTime;

    public String getUploadImgPath() {
        return SYSTEM.toLowerCase().contains("windows") ? uploadImgPath : uploadImgPath.replace("D:","");
    }
}
